<template>
  <a-input-group compact>
    <a-select style="width: 45%" :options="meta.data" :allowClear="true"
              v-model:value="model[meta.field]" @change="(val)=>changeHandle(val, meta)"/>
    <a-input style="width: 55%" v-model:value="model['validateValue']" :allowClear="true" placeholder="校验值"/>
  </a-input-group>
</template>

<script>
    export default {
      name: "IvzFormValidate",
      props: ['meta', 'model'],
      methods: {
        changeHandle(val, meta) {
          if(val instanceof Event) {
            val = val.target.value;
          }

          if(meta.change) {
            let activeMeta = this.$store.getters.activeMeta;
            meta.change(val, activeMeta, this.model);
          }
        },
      }
    }
</script>

<style scoped>

</style>
